home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / sampler4.arc / DUMMY.SAC < prev    next >
Encoding:
Text File  |  1985-08-30  |  10.0 KB  |  228 lines

  1. ON ECHO
  2. !*******************************************************************!
  3. !                                                                   !
  4. !                            Dummy Variables                        !
  5. !                             (Section 6.4)                         !
  6. !                                                                   !
  7. !*******************************************************************!
  8. !
  9. !    SORITEC Sampler generates dummy variables both with the TIME
  10. !    command, as illustrated in the TWOSTAGE example, or the DUMMY
  11. !    command.  DUMMY is used to create a periodic dummy variable 
  12. !    consisting of 1's and 0's.  It is used here in an adaption of an 
  13. !    analysis by R. Pindyck and S. Roberts, "Optimal Policies for 
  14. !    Monetary Control" ,Annals of Economic and Social Measurement, 
  15. !    January 1974, as described in R.S. Pindyck and D.L. Rubinfeld, 
  16. !    Econometric Models and Economic Forecasts. New York: 
  17. !    McGraw-Hill, 1976.  Several changes have been made to the
  18. !    original specification to allow the model to be estimated within
  19. !    the limited workspace of SORITEC Sampler and to accommodate
  20. !    changes in data since the original study was done.  Although
  21. !    results are different, the techniques employed to estimate the
  22. !    model are similar.
  23. !
  24. !    This example estimates an equation to predict the total volume
  25. !    of large denomination time deposits > $100,000 in relation to
  26. !         (1) large denomination time deposits from the previous period
  27. !         (2) interest rates on 6 month tbills
  28. !         (3) interest rates on 6 month CD's
  29. !         (4) personal income
  30. !    These variables are read in below.
  31.  
  32. USE  1974M12   1979M12      
  33.  READ   large_time_deposits interest_tbill interest_CDs personal_income 
  34.               145.5              7.0910        8.820         1209.9      
  35.               147.9              6.5250        7.420         1208.7          
  36.               145.0              5.6740        6.430         1214.3          
  37.               142.0              5.6360        6.330         1219.7          
  38.               137.1              6.0120        6.750         1228.0      
  39.               135.2              5.6490        6.300         1242.1          
  40.               131.5              5.4630        6.250         1272.3          
  41.               128.8              6.4920        7.060         1269.5          
  42.               129.4              6.9400        7.610         1285.6      
  43.               130.4              6.8700        7.890         1295.5          
  44.               131.1              6.3850        7.230         1307.0          
  45.               131.0              5.7510        6.840         1315.2          
  46.               131.1              5.9330        6.560         1321.7      
  47.               128.3              5.2380        5.570         1338.6          
  48.               124.3              5.1440        5.680         1350.8          
  49.               125.3              5.4880        5.870         1356.2          
  50.               124.1              5.2010        5.520         1365.8      
  51.               121.2              5.6000        6.110         1375.0          
  52.               123.3              5.7840        6.310         1380.2          
  53.               124.1              5.5970        5.900         1394.3          
  54.               122.8              5.4160        5.700         1404.8      
  55.               121.2              5.3110        5.580         1413.5          
  56.               119.3              5.0730        5.300         1422.6          
  57.               118.2              4.9440        5.190         1440.5          
  58.               120.0              4.5130        4.760         1452.1      
  59.               118.9              4.7830        5.110         1460.4          
  60.               118.5              4.8960        5.150         1477.1          
  61.               118.9              4.8830        5.160         1493.1          
  62.               117.8              4.7900        5.050         1502.6      
  63.               119.0              5.1930        5.730         1514.1          
  64.               121.8              5.1980        5.640         1526.9          
  65.               124.7              5.3510        5.700         1548.2          
  66.               129.3              5.8100        6.200         1559.7      
  67.               132.2              5.9910        6.450         1575.3          
  68.               136.7              6.4100        6.960         1593.5          
  69.               142.0              6.4330        6.930         1608.9          
  70.               148.0              6.3770        6.950         1625.0      
  71.               150.8              6.6850        7.250         1628.5          
  72.               153.9              6.7400        7.250         1642.9          
  73.               159.5              6.6440        7.180         1663.4          
  74.               163.0              6.7000        7.380         1686.9      
  75.               168.7              7.0190        7.840         1700.9          
  76.               171.1              7.2000        8.240         1720.1          
  77.               174.8              7.4710        8.560         1745.9          
  78.               180.4              7.3630        8.440         1761.6      
  79.               182.6              7.9480        8.960         1777.8          
  80.               184.9              8.4930        9.840         1801.2          
  81.               193.9              9.2040        11.15         1819.5          
  82.               199.3              9.3970        11.28         1843.3      
  83.               200.4              9.5010        11.09         1853.4          
  84.               202.4              9.3490        10.62         1870.2          
  85.               202.7              9.4580        10.47         1891.8          
  86.               198.6              9.4980        10.34         1902.2      
  87.               198.7              9.5310        10.44         1915.8          
  88.               196.5              9.0620        9.980         1931.9          
  89.               198.6              9.1900        10.23         1965.3          
  90.               204.0              9.4500        10.86         1983.1      
  91.               211.1              10.125        12.01         1997.4          
  92.               218.2              11.339        13.83         2016.8          
  93.               222.7              11.856        13.97         2034.2          
  94.               226.3              11.847        13.42         2052.2      
  95. ;
  96. END
  97.  
  98.  
  99. !    A set of dummy variables is introduced to explain as much seasonal
  100. !    behavior as possible.  The seasonal variables s1,s2, etc. take the
  101. !    form of monthly dummy variables multiplied by personal income.  Thus,
  102. !    the first seasonal variable takes the value 1 when the observation
  103. !    occurs in the month of January, 2 for February, etc., meaning that
  104. !    there are a total of 12 seasonal dummy variables in the model.
  105. !
  106. !    First, reset the USE period.
  107.  
  108. USE  1975M1  1979M12      
  109.  
  110. !
  111. !    We'll use two of SORITEC SAMPLER's facilities, the DOT-loop and
  112. !    direct addressing of subscripts to eliminate some of the 
  113. !    repetition of defining 12 seasonal dummy variables.
  114. !
  115. !    First, set up an index variable, j.
  116. !
  117.  
  118. SET j=0
  119.  
  120. !
  121. !    The way we define the dummy variables generates MISSING values
  122. !    prior to the first non-zero value (we could avoid this by defining
  123. !    the USE period from 1974M1).  Since we are going to perform 
  124. !    mathematical operations on the data, we must tell SORITEC to
  125. !    impute MISSING values as zero.  We do this by the command:
  126.  
  127. IMPUTE ZERO
  128.  
  129. !    Now start the DOT loop.
  130.  
  131. DOT s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12
  132.  
  133. DUMMY :(j) 1975m1 12
  134.      
  135. !
  136. !    Since we must multiply the dummy variables by personal income,
  137. !    do it while we are still in the loop.
  138. !
  139.  
  140. : = : * personal_income
  141.  
  142. !
  143. !    Increment the subscript index.
  144. !
  145.  
  146. SET j = j + 1
  147.  
  148. ENDDOT
  149.  
  150. !
  151. !    A partial listing of the dummy variables reveals what they look like.
  152. !
  153.  
  154. USE 1979m1 1979m6
  155. PRINT s1 s2 s3 s4 s5 s6
  156. USE  1975m1  1979m12      
  157.  
  158. !
  159. !    Since transformations are not permitted as arguments in SORITEC's
  160. !    estimation commands, they must be performed before estimating the
  161. !    model.  In addition to the 12 seasonal dummies, independent variables
  162. !    in the model are:
  163. !         (1) large_time_deposits(-1)
  164. !         (2) interest_tbill * personal_income
  165. !         (3) interest_CDs * personal_income
  166. !
  167. !    Lags can be specified in estimation commands so we do not need to
  168. !    transform the first independent variable.  Transformations (2) and
  169. !    (3) can be executed in a DOT-loop.
  170. !
  171.  
  172. DOT interest_tbill interest_CDs 
  173.  
  174. !
  175. !    We'll indicate that the independent variables have been
  176. !    transformed by prefixing each variable name by pi_.
  177. !
  178.  
  179. pi_: = : * personal_income
  180. ENDDOT
  181.  
  182. !
  183. !    Now estimate the equation with the REGRESS command!  Similar to
  184. !    the Pindyck and Roberts study, we shall constrain the fitted
  185. !    equation through the origin by adding the ORIGIN keyword to the
  186. !    command line.  We'll also refer to the 12 seasonal dummies as a
  187. !    GROUP so that we don't have to enter the 12 variable names.
  188. !
  189.  
  190. !
  191. !    First define the dummy variables in a GROUP, i.e.,
  192. !
  193.  
  194. GROUP dummy_group s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12
  195.  
  196. !   
  197. !    Now permit GROUP expansion by enabling the GROUP option
  198. !
  199.  
  200. ON GROUP
  201.  
  202. !
  203. !    This is a fairly large problem for SORITEC Sampler's limited
  204. !    workspace.  You can conserve space by disabling the NOMATS
  205. !    option with the OFF NOMATS command.  This suppresses the
  206. !    storage of the variance-covariance and correlation matrices
  207. !    associated with the regression.
  208. !
  209.  
  210. OFF NOMATS
  211.  
  212. REGRESS(ORIGIN) large_time_deposits large_time_deposits(-1) &
  213.                           pi_interest_tbill pi_interest_CDs &
  214.                           dummy_group
  215.  
  216. !
  217. !    Turn off the impute flag.
  218. !
  219.  
  220. IMPUTE NONE
  221.  
  222. !
  223. !    That's it!  Note that the seasonal dummies exhibit similar
  224. !    seasonal trends to those in the original study.
  225. !
  226. QUIT
  227.  
  228.